#include "ThreadPool.hpp"
#include "Task.hpp"
#include <memory>
#include <unistd.h>

int main()
{
    // std::unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    // tp->Thread_Work();

    ThreadPool<Task>::getInstance()->Thread_Work();
    int x, y;
    char op;
    while (true)
    {
        std::cout << "请输入第一个操作数1# ";
        std::cin >> x;
        std::cout << "请输入第二个操作数2# ";
        std::cin >> y;
        std::cout << "请输入一个操作符 " << "["<<opArr << "]# ";
        std::cin >> op;
        Task t(x, y, op, mymath);
        std::cout<<"刚刚录入了一个任务为: "<<t.toTaskName()<<std::endl;
        // tp->Push(t);
        ThreadPool<Task>::getInstance()->Push(t);
        sleep(1);
    }
    return 0;
}